package cn.tedu.csmall.product.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 添加类别的参数类
 */
@Data
@Accessors(chain = true)
public class CategoryAddNewParam implements Serializable {

    /**
     *类别名称
     */
    @NotNull(message = "添加类别失败，必须提交类别名称！")
    @ApiModelProperty(value = "类别名称",required = true,example = "数码兽")
    private String name;

    /**
     *父级类别id，如果无父级，则为0
     */
    @Range(min = 0,message = "添加类别失败，父级类别id必须为正数！")
    @ApiModelProperty(value = "父级类别id",required = false,example = "1")
    private Long parentId;

    /**
     *关键词列表，各关键词使用英文的逗号分隔
     */
    @ApiModelProperty(value = "关键词列表",required = false,example = "滚球兽,比丘兽,天女兽")
    private String keywords;

    /**
     *排序序号
     */
    @NotNull(message = "添加类别失败，必须提交排序序号！")
    @Range(max = 99, message = "添加类别失败，排序序号值必须在0~99之间！")
    @ApiModelProperty(value = "排序序号",required = true,example = "1")
    private Integer sort;

    /**
     *图标图片的URL
     */
    @ApiModelProperty(value = "图标图片的URL",required = false,example = "http://...")
    private String icon;

    /**
     *是否启用，1=启用，0=未启用
     */
    @Range(max = 1,message = "添加类别失败，是否启用必须是0或1")
    @ApiModelProperty(value = "是否启用",required = true,example = "1")
    private Integer enable;

    /**
     *是否显示在导航栏中，1=启用，0=未启用
     */
    @Range(max = 1,message = "添加类别失败，是否显示在导航栏必须是0或1")
    @ApiModelProperty(value = "是否显示在导航栏中",required = true,example = "1")
    private Integer isDisplay;

}
